//
//  SingleObject.m
//  SYPerfectDemo
//
//  Created by Lssyyy on 2018/6/4.
//  Copyright © 2018年 Lssyyy. All rights reserved.
//

#import "SingleObject.h"

@interface SingleObject()

@end

@implementation SingleObject
NSString *myExtern = @"keyAAA";
static SingleObject *kSingleObject = nil;

//+ (instancetype)sharedInstance{
//    static dispatch_once_t onceToken;
//    dispatch_once(&onceToken, ^{
//        kSingleObject = [[super allocWithZone:NULL] init];
//    });
//    return kSingleObject;
//}

+ (instancetype)sharedInstance{
    static dispatch_once_t onceToken;
    
    dispatch_once(&onceToken, ^{
        kSingleObject = [[SingleObject alloc]init];
    });
    return kSingleObject;
}

+ (id)allocWithZone:(struct _NSZone *)zone{
    return [self sharedInstance];
}


- (id)copy{
    return kSingleObject;
}

- (id)mutableCopy{
    return kSingleObject;
}
@end
